home *** CD-ROM | disk | FTP | other *** search
/ Go Ronald / Go Ronald Voice Interactive CD.iso / Data1.cab / _10A24958756D461ABEA06A2B5283AF28 / scripts / FLabelSymbol.as < prev    next >
Text File  |  2005-08-05  |  2KB  |  55 lines

  1. _global.FLabelClass = function()
  2. {
  3.    if(this.hostComponent == undefined)
  4.    {
  5.       this.hostComponent = this._parent.controller != undefined ? this._parent.controller : this._parent;
  6.    }
  7.    if(this.customTextStyle == undefined)
  8.    {
  9.       if(this.hostComponent.textStyle == undefined)
  10.       {
  11.          this.hostComponent.textStyle = new TextFormat();
  12.       }
  13.       this.textStyle = this.hostComponent.textStyle;
  14.       this.enable = true;
  15.    }
  16. };
  17. FLabelClass.prototype = new MovieClip();
  18. Object.registerClass("FLabelSymbol",FLabelClass);
  19. FLabelClass.prototype.setLabel = function(label)
  20. {
  21.    var _loc2_ = this.hostComponent.styleTable.embedFonts.value;
  22.    if(_loc2_ != undefined)
  23.    {
  24.       this.labelField.embedFonts = _loc2_;
  25.    }
  26.    this.labelField.setNewTextFormat(this.textStyle);
  27.    this.labelField.text = label != undefined ? label : "";
  28.    if(this.labelField.text != "")
  29.    {
  30.       this.labelField._height = this.labelField.textHeight + 2;
  31.    }
  32. };
  33. FLabelClass.prototype.setSize = function(width)
  34. {
  35.    this.labelField._width = width;
  36. };
  37. FLabelClass.prototype.setEnabled = function(enable)
  38. {
  39.    this.enable = enable;
  40.    var _loc2_ = this.hostComponent.styleTable[!enable ? "textDisabled" : "textColor"].value;
  41.    if(_loc2_ == undefined)
  42.    {
  43.       _loc2_ = !enable ? 8947848 : 0;
  44.    }
  45.    this.setColor(_loc2_);
  46. };
  47. FLabelClass.prototype.getLabel = function()
  48. {
  49.    return this.labelField.text;
  50. };
  51. FLabelClass.prototype.setColor = function(col)
  52. {
  53.    this.labelField.textColor = col;
  54. };
  55.